package com.cyclingAssistant.project;

import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapController;
import org.osmdroid.views.MapView;

import com.cyclingAssistant.route.DrawRoute;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;

public class TobeDelete extends Activity {
	MapView mapView;
	private MapController mapController;
	DrawRoute drawRoute;
	@Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mapView = (MapView) findViewById(R.id.mapview);
        mapView.setTileSource(TileSourceFactory.MAPNIK);
        mapView.setBuiltInZoomControls(true);
        mapController = mapView.getController();
        mapController.setZoom(15);
        GeoPoint from = new GeoPoint(49.26341, -123.121845);
        GeoPoint to = new GeoPoint(49.264139, -123.241815);
//        GeoPoint centerGeoPoint = new GeoPoint(from., aLongitude)
        mapController.setCenter(from);
        
        
        drawRoute = new DrawRoute(Color.BLUE, this, true, false);
        drawRoute.setEndLat(49.26341);
        drawRoute.setEndLng(-123.121845);
        try {
			drawRoute.showDirectionsToPredefinedLocation(49.264139, -123.241815, false, "en", true);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		mapView.getOverlays().add(drawRoute);
		mapView.invalidate();
    }
}
